package com.dks.controller;

import java.util.*;

import com.dks.models.RecordDate;
import com.dks.repository.IRecordDateRepository;
import com.dks.result.ResultModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("record_date")

public class RecordDateController {

    @Resource
    private IRecordDateRepository recordDateRepository;


    @PostMapping("insert")
    public ResultModel<Boolean> insert(@RequestBody RecordDate recordDate) {
        return recordDateRepository.insert(recordDate);
    }


    @PostMapping("update")
    public ResultModel<Boolean> update(@RequestBody RecordDate recordDate) {
        return recordDateRepository.update(recordDate);
    }

    @PostMapping("delete")
    public ResultModel<Boolean> delete(@PathVariable Integer id) {
        return recordDateRepository.delete(id);
    }

    @GetMapping("select")
    public ResultModel<Boolean> select(@Param("id") Integer id) {
        return recordDateRepository.select(id);
    }

    /**
     * web端获取全部排期列表
     */
    @GetMapping("selectByList")
    public ResultModel<Boolean> selectByList() {
        return recordDateRepository.selectByList();
    }


}
